Page({
  data: {
    PageCur: 'user',
    role:""
  },
  NavChange(e) {
    wx.setStorageSync('PageCur', e.currentTarget.dataset.cur)
    this.setData({
      PageCur: e.currentTarget.dataset.cur
    })
    const curCms = this.selectComponent("#"+this.data.PageCur);
    curCms.onShow && curCms.onShow()
  },
  onShow(){
    const role = wx.getStorageSync('role')
    this.setData({
      role
    })
    if(role === "茶艺师"){
      this.setData({
        PageCur:"teaerOrder"
      })
      return;
    }
    if(role === "保洁"){
      this.setData({
        PageCur:"basics"
      })
      return;
    }
    this.setData({
      PageCur:wx.getStorageSync('PageCur') || "order"
    })
    const curCms = this.selectComponent("#"+this.data.PageCur);
    curCms.onShow && curCms.onShow()
  },
  onShareAppMessage() {
    return {
      title: '偶遇京城商户中心',
      path: '/pages/index/index'
    }
  },
})